package com.sam.provider.imp.service;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
import com.sam.provider.interfaces.service.Service;

public class ListService implements Service {

    @SuppressWarnings("rawtypes")
    @Override
    public List getList(int initSize) throws Exception {

        if (initSize <= 10 && initSize > 0) {
            return new Vector(initSize);
        }
        else if (initSize > 10 && initSize <= 20) {
            return new ArrayList(initSize);
        }
        else if (initSize > 20) {
            return new LinkedList();
        }
        else {
            throw new IllegalAccessException("initSize must greter than 0");
        }
    }
}
